This application claims the priority benefit of Taiwan application serial no. 88113559, filed Aug. 9, 1999.
1. Field of the Invention
This invention relates to optical disc technology, and more particularly, to a method of managing defect areas on an erasable optical disc in a dynamic manner.
2. Description of Related Art
An erasable optical disc is a type of data storage medium where data can be repeatedly written and erased. On an erasable optical disc, however, some part of the storage space can be damaged due to various reasons, which is no longer usable for data storage. Conventionally, defect areas can be mended by using spare areas in the other part of the same optical disc. Methods for this purpose are customarily referred to as defect management.
There are two common causes for defect areas on an optical disc: surface defect, which is customarily referred to as the first-class defect; and excessive read/write defect, which is referred to as the second-class defect. The second-class defect is customarily defined in terms of logical block; i.e., for a logical block of 16 sectors, if any one of the 16 sectors is bad, the entire logical block is marked as a bad logical block and will not be thereafter used for data storage even though the other 15 sectors are still good.
FIG. 1 is a schematic diagram used to depict a conventional method for managing defect areas on an erasable optical disc 30. As shown, this defect management method is performed by a file system 10 and an optical drive 20. The file system 10 is a software driver running on a computer system (not shown) on which the optical drive 20 is installed. The optical drive 20 includes an optical head 22, a microprocessor 24, and an interface 26. The optical drive 20 is coupled to the file system 10 via the interface 26 so that the optical drive 20 can be controlled by the file system 10 to perform read/write operations on the optical disc 30. Data and commands from the file system 10 are processed by the microprocessor 24 for controlling the optical head 22 to perform specified read/write operations on the erasable optical disc 30.
The storage space of the erasable optical disc 30 is organized into a system-dedicated read/write area 32, a formatted area 34, and a spare area 36. During normal read/write operations, data are written into the formatted area 34. However, when the formatted area 34 give rise to bad logical blocks 35, good logical blocks in the spare area 36 are used to substitute these bad logical blocks 35 (these good logical block are hereinafter referred to as substitution logic blocks), and the addresses of the substitution logic block 37 are registered in the system-dedicated read/write area 32. Both the system-dedicated read/write area 32 and the spare area 36 are reserved areas where the user is not allowed to change the data stored therein.
The procedure performed by the file system 10 and the optical drive 20 for managing the bad logical blocks on the erasable optical disc 30 includes the following steps.
(Step 1)
After the erasable optical disc 30 is inserted in position in the optical drive 20, the microprocessor 24 first commands the optical head 22 to move to the system-dedicated read/write area 32 to read the addresses of the bad logical blocks 35 in the formatted area 34 and the addresses of their substitution logic blocks 37 in the spare area 36. The micro-processor 24 then stores these address data in the internal registers thereof.
(Step 2)
During read/write operation, when the optical head 22 encounters a bad logical block in the formatted area 34, it promptly informs the microprocessor 24 of this condition.
(Step 3)
In response, the microprocessor 24 checks whether the currently-encountered bad logical block is an old one or not, i.e., whether it was previously found and is already registered in the system-dedicated read/write area 32, by checking whether it matches to any of the address data currently held in the internal register of the microprocessor 24. If YES, the procedure jumps to the step (6); otherwise, if NOT, it indicates that this bad logical block is a newly produced one, and the microprocessor 24 sends a request signal via the interface 26 to the file system 10.
(Step 4)
In response to this request, the file system 10 proposes a mending method for this newly-produced bad logical block, and then sends the mending method back via the interface 26 to the microprocessor 24.
(Step 5)
In response, the microprocessor 24 first checks that if the spare area 36 still have sufficient storage space to substitute for this newly-produced bad logical block; and if YES, the microprocessor 24 selects a good logical block to serve as the substitution logic block 37 for the bad logical block, and then fetches the address of this substitution logic block 37. The microprocessor 24 then commands the optical head 22 to write the address of the substitution logic block into the system-dedicated read/write area 32. And then, the system 10 goes to Step 7.
(Step 6)
As the address of the substitution logic block 37 is set, the microprocessor 24 drives the optical head 22 to move from the currently-encountered defect area to the substitution logic block 37 in the spare area 36, an d then write d at a into the substitution logic block.
(Step 7)
After the write operation is completed, the microprocessor 24 sends an OK signal via the interface 26 to th e file system 10.
(Step 8)
In response, the file system 10 display a message to the user, telling that the write operation is completed. The user can then remove the optical disc 30 from the optical drive 20. After the optical disc 30 is removed, the microprocessor 24 clears its internal register for those address of the substitution logic block 37.
In the foregoing procedure, the communication between the file system 10 and the optical drive 20 requires a comprehensive set of commands and data signals for effective management of the defect areas on the optical disc 30. The prior art, however, is considered insufficient in this respect.
Moreover, the spare area 36 in the optical disc 30 is fixed in size when being formatted. During read/write operation, when the optical drive 20 encounters a bad logical block, it will move to the spare area 36 and find a good logical block there to serve as a substitution for the currently-encountered bad logical block. This action is customarily referred to as linear replacement. In the prior art, the starting and ending addresses of the spare area 36 are all fixed and cannot be dynamically varied.
The fixed-size scheme for the spare area 36, however, has the following draw-backs.
First, it would make the substitution logic block in the repair areas 37 separated far away from the corresponding bad logic block in the formatted area 34, which would cause the optical head 22 to move a long distance from the bad logical block to the substitution logic block. As a result, the access time is increased.
Second, it is possible that the spare area 36 would give rise to bad logical blocks after the optical disc 30 has been repeatedly accessed for many times. Should this be the case, there would be no substitution logical blocks available to serve as substitutions for these newly-produced bad logical blocks in the spare area 36; and therefore, the spare area 36 may eventually become insufficient to serve its purpose. When this happens, the optical disc 30 would be no longer capable of mending any bad logical blocks in the formatted area 34. The prior art thus can only provide a limited period of service for the management of defect areas on the optical disc 30.
It is at least an objective of this invention to provide a method of managing defect areas on an erasable optical disc. The method can dynamically assign and find out a supplementary spare area residing in the formatted area, so that the spare area can be more efficiently managed
It is another objective of this invention to provide a method of managing defect areas on an erasable optical disc, which allows the file system and the optical drive to communicate with each other with a comprehensive set of commands and data signals which allow the management to be performed more dynamically and efficiently than the prior art.
It is still another objective of this invention to provide a method of managing defect areas on an erasable optical disc, which allows the access operation to the optical disc to be performed more quickly than the prior art by reducing the time required to move the optical head from a bad logical block to the substitution one.
It is still another objective of this invention to provide a method of managing defect areas on an erasable optical disc, which can be used for a long time even though the number of bad logical blocks on the optical disc is ever increasing.
In accordance with the foregoing and other objectives, the invention proposes a new method for managing defect areas on an erasable optical disc.
The method of the invention includes the following steps: (1) partitioning the optical disc into a formatted area and an unformatted area; and then partitioning the formatted area into a main spare area and a user read/write area, where the main spare area including a plurality of substitution logic blocks which can be selected to serve as a substitution for a bad logical block in the user read/write area, if found; the starting and ending addresses of each bad logical block and its substitution logic block being registered in the unformatted area; (2) when all the good logical blocks in the main spare area are used up, defining a supplementary spare area in the user read/write area, and registering the starting and ending addresses of this supplementary spare area in the unformatted area; (3) when an additional bad logical block is found in the user read/write area, selecting a good logical block from the supplementary spare area to serve as a substitution for this newly-found bad logical block; and then registering the address of this newly-found bad logical block and the address of the substitution logic block into the unformatted area; and (4) repeating the steps (2) and (3) if all the good logical blocks in the current supplementary spare area are used up and an additional bad logical block is found.
Alternatively, the invention can be defined in such a manner as to be used in conjunction with a file system and an optical drive. In this respect, the method of the invention includes the following steps: (1) actuating the optical drive to partition the optical disc into a formatted area and an unformatted area, and then partition the formatted area into a main spare area and a user read/write area, where the main spare area including a plurality of logic blocks which can be selected to serve as a substitution for a bad logical block in the user read/write area, if found; the starting and ending addresses of each bad logical block and its substitution logic block being registered in the unformatted area; (2) when the good logical blocks in the main spare area are used up, actuating the optical drive to define a supplementary spare area in the user read/write area, and registering the starting and ending addresses of this supplementary spare area in the unformatted area; (3) when an additional bad logical block is found in the user read/write area, actuating the optical drive to select a good logical block from the supplementary spare area to serve as a substitution for this newly-found bad logical block; and then registering the address of this newly-found bad logical block and the address of the substitution logic block into the unformatted area; and (4) actuating the optical drive to repeat the steps (2) and (3) if the good logical blocks in the current supplementary spare area are used up and an additional bad logical block is found.
Defined in a more restricted manner, the method of the invention includes the following steps: (1) actuating the optical drive to partition the optical disc into a formatted area and an unformatted area, and then partition the formatted area into a main spare area and a user read/write area, where the main spare area including a plurality of substitution logic blocks which can be selected to substitute a bad logical block in the user read/write area, if found; the starting and ending addresses of each bad logical block and its substitution logic block being registered in the unformatted area; (2) when the good logical blocks in the main spare area are used up, actuating the optical drive to issue a request to the file system for finding a continuous unused storage area in the user read/write area; (3) actuating the optical drive to send an address signal indicative of the starting and ending addresses of all the available continuous unused storage areas on the optical disc; (4) actuating the optical drive to send an address signal indicative of the starting and ending addresses of every currently-defined supplementary spare area on the optical disc; (5) actuating the file system to define a supplementary spare area from a continuous unused storage area and send an address signal indicative of the starting and ending addresses of this supplementary spare area to the optical drive; (6) actuating the file system to write the starting and ending addresses of the newly-defined supplementary spare area into the unformatted area of the optical disc; (7) when the good logical blocks in the main spare area are used up, actuating the optical drive to use the newly-defined supplementary spare area in place of the main spare area; (8) when an additional bad logical block is found in the user read/write area, actuating the optical drive to select a good logical block from the supplementary spare area to serve as a substitution for this bad logical block; and then registering the address of this newly-found bad logical block and the address of the corresponding substitution logic block into the unformatted area; and (9) jumping to the step (2) if the good logical blocks in the current supplementary spare area are used up and an additional bad logical block is found.